<?php
    /**
    *   $aProduct = array(
    *       'name' => '',
    *       'image' => 'Nokia 1202',
    *       'price' => '34234',
    *       'ownUser' => 'khai',
    *       'uri' => 'http...',
    *       'description' => '',
    *       'id' => '',
    *       'isAjax' => 'true',
    *       'layout' => 'default',
    *       'noHightLight' => true,
    *   ); 
    */
?>
<?php if(!($template->get('isAjax'))){?><div class="product_content" id="<?php echo (($template->get('id')) ? $template->get('id') : ''); ?>"><?php } ?>
    <?php 
        if($template->get('aProducts'))
        {
            foreach($template->get('aProducts') as $aProduct)
            {

                $aParams = array('aProduct' => $aProduct);
                if(!$template->get('noHightLight'))
                {
                    if(isset($aProduct['isHightLight']))
                    {
                        includeBlock('entity/'.(isset($_SESSION['defaultProductHightLightLayout']) ? $_SESSION['defaultProductHightLightLayout'] : 'default').'HightLightProductEntity', $aParams);
                    }
                    else
                    {
                        includeBlock('entity/'.($template->get('layout') ? $template->get('layout') : 'default').'ProductEntity', $aParams);
                    } 
                }
                else
                {
                    includeBlock('entity/'.($template->get('layout') ? $template->get('layout') : 'default').'ProductEntity', $aParams);
                }
            }
        }
    ?>
<?php if(!($template->get('isAjax'))){?></div><?php } ?>